package view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;

import business.Pesquisar;

import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class PesquisarDisciplina extends javax.swing.JFrame {
	private JLabel jLblNome;
	private JTextField jTextFieldDisciplina;
	private JButton jBtnCancelar;
	private JButton jBtnpesquisar;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				PesquisarDisciplina inst = new PesquisarDisciplina();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public PesquisarDisciplina() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			AnchorLayout thisLayout = new AnchorLayout();
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setBackground(new java.awt.Color(192,192,192));
			this.setIconImage(new ImageIcon(getClass().getClassLoader().getResource("file/pesquisa2.png")).getImage());
			this.setTitle("Pesquisar Disciplina");
			{
				jBtnCancelar = new JButton();
				getContentPane().add(jBtnCancelar, new AnchorConstraint(716, 824, 939, 723, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jBtnCancelar.setPreferredSize(new java.awt.Dimension(44, 42));
				jBtnCancelar.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
				jBtnCancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("file/cancelar.jpg")));

				jBtnCancelar.addActionListener(new  ActionListener() {
					
					@Override
					public void actionPerformed(ActionEvent e) {
						dispose();
						
					}
				});
				
			}
			{
				jBtnpesquisar = new JButton();
				getContentPane().add(jBtnpesquisar, new AnchorConstraint(716, 955, 933, 852, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jBtnpesquisar.setPreferredSize(new java.awt.Dimension(45, 41));
				jBtnpesquisar.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
				jBtnpesquisar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("file/pesquisar.gif")));

				jBtnpesquisar.addActionListener(new ActionListener() {
					
					String pesquisarNomeDisciplina;
							@Override
							public void actionPerformed(ActionEvent e) {
								
							pesquisarNomeDisciplina = jTextFieldDisciplina.getText();
							Pesquisar pesquisaCurso= new Pesquisar();
							pesquisaCurso.pesquisarCurso(pesquisarNomeDisciplina);
							}
						});
				
				
			}
			{
				jTextFieldDisciplina = new JTextField();
				getContentPane().add(jTextFieldDisciplina, new AnchorConstraint(71, 537, 193, 152, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jTextFieldDisciplina.setText("Escreva aqui a Disciplina");
				jTextFieldDisciplina.setPreferredSize(new java.awt.Dimension(168, 23));
				jTextFieldDisciplina.setBackground(new java.awt.Color(212,208,200));
				jTextFieldDisciplina.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
			}
			{
				jLblNome = new JLabel();
				getContentPane().add(jLblNome, new AnchorConstraint(66, 161, 198, 17, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jLblNome.setText("Disciplina:");
				jLblNome.setPreferredSize(new java.awt.Dimension(63, 25));
			}
			pack();
			this.setSize(452, 227);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
